<template>
	<view>
		<view>用户名:<input type="text" placeholder="请输入账号" v-model="username"/></view>
		<view>密码:<input type="text" placeholder="请输入密码" v-model="password"/></view>
		<view><button @click="login">登录</button></view>
	</view>
</template>

<script setup>
import {ref} from 'vue'
const username=ref("")
const password=ref("")
const login=()=>{
	console.log(username.value,password.value)
	uni.request({
		url:"http://localhost:3000/login",
		data:{
			username:username.value,
			password:password.value
		}
	}).then((resp)=>{
		let {code,msg}=resp.data
		if(code==200){
			uni.navigateTo({
				url:"/pages/Search/Search"
			})
		}
	})
}
</script>

<style lang="scss">

</style>
